\subsection{Database structure}
\label{sec:database}
On \cref{lst:database}, the structure of the database can be seen. As it can be seen, there are three tables; countries, city and continents.
\begin{code}{lst:database}{The structure of the database}
\begin{lstlisting}
CREATE DATABASE  IF NOT EXISTS `weminiproject`;
USE `weminiproject`;

CREATE TABLE `countries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `population` int(11) DEFAULT NULL,
  `car_code` varchar(5) NOT NULL,
  `capital` varchar(100) NOT NULL,
  `continentid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

INSERT INTO `countries` VALUES (1,'Denmark',5500000,'DK','Copenhagen',1),(2,'South Africa',54000000,'ZA','Pretoria',2),(3,'Germany',80000000,'DE','Berlin',1);

CREATE TABLE `city` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `population` int(11) DEFAULT NULL,
  `countryid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
INSERT INTO `city` VALUES (1,'Aalborg',110000,1),(2,'Copenhagen',1360000,1),(3,'Johannesburg',12700000,2),(4,'Pretoria',740000,2),(5,'Berlin',3500000,3),(6,'Aarhus',3100000,1);

CREATE TABLE `continents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
INSERT INTO `continents` VALUES (1,'Europe'),(2,'Africa');
\end{lstlisting}
\end{code}